import { useAccount } from '@/store/user'
import React, { ReactNode } from 'react'

type Props = {
    children:ReactNode,
    permit:Array<string>  // ['超级管理员','管理员']
}

export default function ButtonAuth({children,permit}: Props) {
  const {userInfo} = useAccount()
  let bool = userInfo && permit.includes(userInfo.name)
  return (
    <>
        {bool?children:''}
    </>
  )
}